﻿// MT293




using Little.Soldier.SWIFT;
using Little.Soldier.SWIFT.Definition;
using System.Collections.Generic;
using System.ComponentModel;

namespace Little.Soldier.SWIFT.Messages.Category2
{
  public class MT293 : SwiftMessage
  {
    private static SwiftMessageDefinition MessageDefinition;
    private static SwiftTagSequenceDefinition U0002;
    private static SwiftTagDefinition U0003;
    private static SwiftTagSubItemDefinition U0004;
    private static SwiftTagDefinition U0005;
    private static SwiftTagSubItemDefinition U0006;
    private static SwiftTagSubItemDefinition U0007;
    private static SwiftTagDefinition U0008;
    private static SwiftTagSubItemDefinition U000E;
    private static SwiftTagSubItemDefinition U000F;
    private static SwiftTagSubItemDefinition U0010;
    private static SwiftTagSubItemDefinition U0011;
    private static SwiftTagSubItemDefinition U0012;
    private static SwiftTagDefinition U0013;
    private static SwiftTagSubItemDefinition U0014;
    private static SwiftTagDefinition U0015;
    private static SwiftTagSubItemDefinition U0016;
    private static SwiftTagDefinition U0017;
    private static SwiftTagSubItemDefinition U0018;
    private static SwiftTagSequenceDefinition U0019;
    private static SwiftTagDefinition U001A;
    private static SwiftTagSubItemDefinition U001B;

    [Description("Envelope Information")]
    public MT293.SequenceAClass SequenceA
    {
      get
      {
        return new MT293.SequenceAClass((SwiftElement) this, 0, false);
      }
    }

    [Description("Envelope Contents")]
    public MT293.SequenceBClass SequenceB
    {
      get
      {
        return new MT293.SequenceBClass((SwiftElement) this, 0, false);
      }
    }

    public MT293()
      : base(true)
    {
    }

    public MT293(SwiftMessage message)
      : base(message)
    {
    }

    internal override SwiftMessageDefinition MsgDefinition()
    {
      return MT293.MessageDefinition;
    }

    protected override void InitSwiftMessageDefinition()
    {
      MT293.MessageDefinition = new SwiftMessageDefinition("MT293", "Information Service Message");
      MT293.U0002 = new SwiftTagSequenceDefinition("SequenceA", "Envelope Information");
      MT293.U0003 = new SwiftTagDefinition("SendersReference_A_20", "Sender’s Reference");
      MT293.U0003.TagName = ":20:";
      MT293.U0004 = new SwiftTagSubItemDefinition("Reference", "Reference");
      MT293.U0003.Elements.Add((SwiftDefinitionElement) MT293.U0004);
      MT293.U0002.Elements.Add((SwiftDefinitionElement) MT293.U0003);
      MT293.U0005 = new SwiftTagDefinition("MessageIndexTotal_A_28D", "Message Index/Total");
      MT293.U0005.TagName = ":28D:";
      MT293.U0006 = new SwiftTagSubItemDefinition("Number", "Number");
      MT293.U0005.Elements.Add((SwiftDefinitionElement) MT293.U0006);
      MT293.U0007 = new SwiftTagSubItemDefinition("Total", "Total");
      MT293.U0005.Elements.Add((SwiftDefinitionElement) MT293.U0007);
      MT293.U0002.Elements.Add((SwiftDefinitionElement) MT293.U0005);
      MT293.U0008 = new SwiftTagDefinition("TypeOfServiceMarketAndData_A_14T", "Type of Service, Market and Data");
      MT293.U0008.TagName = ":14T:";
      MT293.U0008.Multiple = true;
      MT293.U000E = new SwiftTagSubItemDefinition("Type", "Type");
      MT293.U0008.Elements.Add((SwiftDefinitionElement) MT293.U000E);
      MT293.U000F = new SwiftTagSubItemDefinition("Market", "Market");
      MT293.U000F.Mandatory = false;
      MT293.U0010 = new SwiftTagSubItemDefinition("Market_1", "Market");
      MT293.U000F.Elements.Add((SwiftDefinitionElement) MT293.U0010);
      MT293.U0011 = new SwiftTagSubItemDefinition("Data", "Data");
      MT293.U0011.Mandatory = false;
      MT293.U0012 = new SwiftTagSubItemDefinition("Data_1", "Data");
      MT293.U0011.Elements.Add((SwiftDefinitionElement) MT293.U0012);
      MT293.U000F.Elements.Add((SwiftDefinitionElement) MT293.U0011);
      MT293.U0008.Elements.Add((SwiftDefinitionElement) MT293.U000F);
      MT293.U0002.Elements.Add((SwiftDefinitionElement) MT293.U0008);
      MT293.U0013 = new SwiftTagDefinition("TypeOfOperation_A_22A", "Type of Operation");
      MT293.U0013.TagName = ":22A:";
      MT293.U0014 = new SwiftTagSubItemDefinition("Type", "Type");
      MT293.U0013.Elements.Add((SwiftDefinitionElement) MT293.U0014);
      MT293.U0002.Elements.Add((SwiftDefinitionElement) MT293.U0013);
      MT293.U0015 = new SwiftTagDefinition("RelatedReference_A_21", "Related Reference");
      MT293.U0015.TagName = ":21:";
      MT293.U0015.Mandatory = false;
      MT293.U0016 = new SwiftTagSubItemDefinition("Reference", "Reference");
      MT293.U0015.Elements.Add((SwiftDefinitionElement) MT293.U0016);
      MT293.U0002.Elements.Add((SwiftDefinitionElement) MT293.U0015);
      MT293.U0017 = new SwiftTagDefinition("SubMessageType_A_12", "Sub-Message Type");
      MT293.U0017.TagName = ":12:";
      MT293.U0018 = new SwiftTagSubItemDefinition("Type", "Type");
      MT293.U0017.Elements.Add((SwiftDefinitionElement) MT293.U0018);
      MT293.U0002.Elements.Add((SwiftDefinitionElement) MT293.U0017);
      MT293.MessageDefinition.Elements.Add((SwiftDefinitionElement) MT293.U0002);
      MT293.U0019 = new SwiftTagSequenceDefinition("SequenceB", "Envelope Contents");
      MT293.U001A = new SwiftTagDefinition("EnvelopeContents_B_77S", "Envelope Contents");
      MT293.U001A.TagName = ":77S:";
      MT293.U001B = new SwiftTagSubItemDefinition("Narrative", "Narrative");
      MT293.U001A.Elements.Add((SwiftDefinitionElement) MT293.U001B);
      MT293.U0019.Elements.Add((SwiftDefinitionElement) MT293.U001A);
      MT293.MessageDefinition.Elements.Add((SwiftDefinitionElement) MT293.U0019);
    }

    public class SequenceAClass : SwiftTagSequence
    {
      internal override SwiftDefinitionElement Definition
      {
        get
        {
          return (SwiftDefinitionElement) MT293.U0002;
        }
      }

      [Description("Sender’s Reference")]
      public Tag20 SendersReference_A_20
      {
        get
        {
          return new Tag20((SwiftElement) this, 0, (SwiftDefinitionElement) MT293.U0003);
        }
      }

      [Description("Sender’s Reference")]
      public Tag20 Tag20_SendersReference_A
      {
        get
        {
          return this.SendersReference_A_20;
        }
      }

      [Description("Message Index/Total")]
      public MT293.SequenceAClass.Tag28D MessageIndexTotal_A_28D
      {
        get
        {
          return new MT293.SequenceAClass.Tag28D((SwiftElement) this, 0, (SwiftDefinitionElement) MT293.U0005);
        }
      }

      [Description("Message Index/Total")]
      public MT293.SequenceAClass.Tag28D Tag28D_MessageIndexTotal_A
      {
        get
        {
          return this.MessageIndexTotal_A_28D;
        }
      }

      [Description("Type of Service, Market and Data")]
      public Tag14T[] TypeOfServiceMarketAndData_A_14T
      {
        get
        {
          int index = -1;
          List<Tag14T> list = new List<Tag14T>();
          int count;
          do
          {
            ++index;
            Tag14T tag14T = new Tag14T((SwiftElement) this, index, (SwiftDefinitionElement) MT293.U0008);
            count = this.ListTags((SwiftElement) tag14T).Count;
            if (count > 0)
              list.Add(tag14T);
          }
          while (count > 0);
          return list.ToArray();
        }
      }

      [Description("Type of Service, Market and Data")]
      public Tag14T[] Tag14T_TypeOfServiceMarketAndData_A
      {
        get
        {
          return this.TypeOfServiceMarketAndData_A_14T;
        }
      }

      [Description("Type of Operation")]
      public Tag22A TypeOfOperation_A_22A
      {
        get
        {
          return new Tag22A((SwiftElement) this, 0, (SwiftDefinitionElement) MT293.U0013);
        }
      }

      [Description("Type of Operation")]
      public Tag22A Tag22A_TypeOfOperation_A
      {
        get
        {
          return this.TypeOfOperation_A_22A;
        }
      }

      [Description("Related Reference")]
      public Tag21 RelatedReference_A_21
      {
        get
        {
          return new Tag21((SwiftElement) this, 0, (SwiftDefinitionElement) MT293.U0015);
        }
      }

      [Description("Related Reference")]
      public Tag21 Tag21_RelatedReference_A
      {
        get
        {
          return this.RelatedReference_A_21;
        }
      }

      [Description("Sub-Message Type")]
      public MT293.SequenceAClass.Tag12 SubMessageType_A_12
      {
        get
        {
          return new MT293.SequenceAClass.Tag12((SwiftElement) this, 0, (SwiftDefinitionElement) MT293.U0017);
        }
      }

      [Description("Sub-Message Type")]
      public MT293.SequenceAClass.Tag12 Tag12_SubMessageType_A
      {
        get
        {
          return this.SubMessageType_A_12;
        }
      }

      internal SequenceAClass(SwiftElement parent, int index, bool createTags)
        : base(parent, index, createTags)
      {
      }

      public Tag14T AddTypeOfServiceMarketAndData_A_14T()
      {
        return new Tag14T((SwiftElement) this, this.TypeOfServiceMarketAndData_A_14T.Length, (SwiftDefinitionElement) MT293.U0008)
        {
          Value = string.Empty
        };
      }

      public void RemoveTypeOfServiceMarketAndData_A_14T(Tag14T tag)
      {
        this.RemoveTag(tag.GetTag());
      }

      public class Tag28D : SwiftTagWrapper
      {
        public string Value
        {
          get
          {
            return this.GetValue();
          }
          set
          {
            this.SetValue("28D", value);
          }
        }

        internal Tag28D(SwiftElement parent, int index, SwiftDefinitionElement definition)
          : base(parent, index, definition)
        {
        }
      }

      public class Tag12 : SwiftTagWrapper
      {
        public string Value
        {
          get
          {
            return this.GetValue();
          }
          set
          {
            this.SetValue("12", value);
          }
        }

        internal Tag12(SwiftElement parent, int index, SwiftDefinitionElement definition)
          : base(parent, index, definition)
        {
        }
      }
    }

    public class SequenceBClass : SwiftTagSequence
    {
      internal override SwiftDefinitionElement Definition
      {
        get
        {
          return (SwiftDefinitionElement) MT293.U0019;
        }
      }

      [Description("Envelope Contents")]
      public Tag77S EnvelopeContents_B_77S
      {
        get
        {
          return new Tag77S((SwiftElement) this, 0, (SwiftDefinitionElement) MT293.U001A);
        }
      }

      [Description("Envelope Contents")]
      public Tag77S Tag77S_EnvelopeContents_B
      {
        get
        {
          return this.EnvelopeContents_B_77S;
        }
      }

      internal SequenceBClass(SwiftElement parent, int index, bool createTags)
        : base(parent, index, createTags)
      {
      }
    }
  }
}
